package com.heima.mapper;

import com.heima.pojo.dto.DeviceQueryDTO;
import com.heima.pojo.dto.PartnerQueryDTO;
import com.heima.pojo.entity.*;
import com.heima.pojo.vo.VendingMachineVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface VmTypeMapper{
    List<VmType> queryPage(PartnerQueryDTO dto);

    void add(VmType vmType);

    int update(Integer typeId, VmType vmType);

    @Delete("delete from tb_vm_type where type_id = #{typeId}")
    int detele(Integer typeId);

    List<VendingMachineVO> searchAll(DeviceQueryDTO deviceQueryDTO);


    @Select("select * from tb_node where id = #{nodeId}")
    Node selectTbNode(String nodeId);

    @Select("select * from tb_area where ad_code = #{areaCode}")
    TbArea selectTbArea(String areaCode);

    void insertTbVendingMachine(TbVendingMachine tbVendingMachine);

    @Select("select * from tb_order where node_id = #{nodeId}")
    TbOrder selectTbOrder(String nodeId);

    @Select("select * from tb_channel where sku_id = #{skuId}")
    TbChannel selectTbChannel(Long skuId);
}